/*
* Copyright (c) 2007 by Kirill Kolodyazhniy.
* See the file "license.terms" for information on usage and redistribution.
*/

#ifndef M_TIMER_H_
#define M_TIMER_H_

#include <windows.h>

namespace Engine
{
	/**
	*   Class present functions for retrieving timings.
	*/
	class Timer
	{
	public:

		/**
		*   Constructor.
		*/
		Timer();

		/**
		*   Reset timer start time.
		*/
		void Reset();

		/**
		*   Return milliseconds since last reset or initialization.
		*/
		unsigned long GetMilliseconds() const;

	private:
		mutable LARGE_INTEGER m_startTime;
        LARGE_INTEGER m_frequency;
		DWORD         m_startTick;
		mutable LONGLONG      m_lastTime;
	};
}

#endif
